// SupportHanger.cpp: implementation of the SupportHanger class.
//
//////////////////////////////////////////////////////////////////////

#include "StdAfx.h"
#include "SHSupportHanger.h"
#include "AttachableVisitor.h"

#include <vector>

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

namespace JointSystem
{

SupportHanger::SupportHanger()
{

}

SupportHanger::~SupportHanger()
{

}

SupportHanger::SupportHanger( SupportHanger& sh ) : JointPortOwner( (JointPortOwner&)sh )
{
	for ( int i = 0; i < sh.GetPartChainCount(); i++ )
		m_PartChains.Add( new PartChain( *sh.GetPartChainAt( i ) ) );
}

BOOL SupportHanger::CanAttachTo( Attachable* totherAtt )
{//tbd
	return FALSE;
}

AttachStatus SupportHanger::AttachTo( Attachable* totherAtt )
{//tbd
	return eFailed;
}

BOOL SupportHanger::PrepareData()
{//tbd
	return FALSE;
}

void SupportHanger::Accept( AttachableVisitor& visitor )
{
	visitor.VisitSupportHanger( *this );
}

void SupportHanger::AddPartChain( PartChain* pc )
{
	for ( int i = 0; i < GetPartChainCount(); i++ )
		if ( GetPartChainAt( i ) == pc )
			return;
	m_PartChains.Add( pc );
}

}
